#include<iostream>
#include<algorithm>
#include<string>
#include<cstring>

using namespace std;

int s[30];

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    int T;
    cin >> T;

    string op;
    while(T--){

        int res = 0;
        memset(s, 0, sizeof s);
        int n;
        cin >> n;
        cin >> op;
        for (int i = 0; i < op.length(); i ++){
            if(!s[op[i] - 'A']){
                res += 2;
                s[op[i] - 'A'] = 1;
            }else{
                res += 1;
            }
        }

        cout << res << endl;
    }

    return 0;
}